    {include file="../view/head" /}
    <style>
    /*页面自定义样式*/
    .sfzimg>img{height:45px;}
    .sfzimg:hover{
        position: fixed;
        left: 10%;
        top: 10%;
        width: 80%;
        height: 80%;
        z-index: 99;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .sfzimg:hover>img{
        width: auto;
        height: auto;
        max-height: 100%;
        max-width: 100%;
    }
    </style>
    </head>
    <body>
        {include file="../view/header" /}
        {include file="../view/sidebar" /}
        {include file="../view/right-sidebar" /}
        <!-- Start #content -->
        <div id="content">
            <!-- Start .content-wrapper -->
            <div class="content-wrapper">
                <div class="row">
                    <!-- Start .row -->
                    <!-- Start .page-header -->
                    <div class="col-lg-12 heading hidden-xs hidden-sm">
                        <!-- Start .bredcrumb -->
                        <ul id="crumb" class="breadcrumb"></ul>
                        <!-- End .breadcrumb -->
                    </div>
                    <!-- End .page-header -->
                </div>
                <!-- End .row -->
                <div class="outlet">
                    <!-- Start .outlet -->
                    <!-- Page start here ( usual with .row ) -->
                    <div class="row">
                        <div class="col-md-12">
                            <!-- col-lg-12 start here -->
                            <div class="panel panel-default toggle panelRefresh">
                                <!-- Start .panel -->
                                <div class="panel-heading" style="padding: 10px 15px;">
                                    <a href="{:url('users/shequ_list',['zt'=>'all'])}" class="btn btn-info">查看全部</a>
                                    <a href="{:url('users/shequ_list',['zt'=>'1'])}" class="btn btn-info">只看已审核</a>
                                    <a href="{:url('users/shequ_list',['zt'=>'2'])}" class="btn btn-info">只看已驳回</a>
                                    <a href="{:url('users/shequ_list',['zt'=>'0'])}" class="btn btn-info">只看未审核</a>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th class="per5">
                                                    <label class="checkbox">
                                                        <input class="check-all" type="checkbox">
                                                    </label>
                                                </th>
                                                <th>会长手机</th>
                                                <th>会长姓名</th>
                                                <th>工会名称</th>
                                                <th data-toggle="tooltip" data-placement="top" title="含会长">人数</th>
                                                <th>申请理由</th>
                                                <th>申请时间</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                                <th>回复原因|备注</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {foreach $lists as $list} 
                                            <?php
                                                $sum_renshu_tilian_shequ=sum_renshu_tilian_shequ($list['uid']);
                                                $user=userinfobyid($list['uid']);
                                            ?>
                                            <tr>
                                                <td>
                                                    <label class="checkbox">
                                                        <input class="check" type="checkbox" value="{$list.id}">
                                                    </label>
                                                </td>
                                                <td>{$list.uname}</td>
                                                <td>{$user.truename?:'<span class="text-info" data-toggle="tooltip" data-placement="left" title="姓名未填，当前显示昵称">'.$user.nicename.'</span>'}</td>
                                                <td>{$list.name}</td>
                                                <th data-toggle="tooltip" data-placement="top" title="含会长">{$sum_renshu_tilian_shequ.renshu}</th>
                                                <td>{$list.xuanyan}</td>
                                                <td>{$list.ctime|date='Y-m-d H:i:s',###}</td>
                                                <td>
                                                    {if condition='$list.zt eq "1"'}
                                                        <span class="text-success">已审核</span>
                                                    {elseif condition='$list.zt eq "2"' /}
                                                        <span class="text-danger">已驳回</span>
                                                    {elseif condition='$list.zt eq "0"' /}
                                                        <span class="text-info">未审核</span>
                                                    {/if}
                                                </td>
                                                <td>
                                                    {if condition='$list.zt eq "1"'}
                                                        <a href="{:url('users/shequ_zt',['id'=>$list.id,'zt'=>2])}" class="mt5 btn btn-xs btn-danger">驳回</a>
                                                    {elseif condition='$list.zt eq "2"' /}
                                                        <a href="{:url('users/shequ_zt',['id'=>$list.id,'zt'=>1])}" class="mt5 btn btn-xs btn-info">通过</a>
                                                    {elseif condition='$list.zt eq "0"' /}
                                                        <a href="{:url('users/shequ_zt',['id'=>$list.id,'zt'=>1])}" class="mt5 btn btn-xs btn-info">通过</a>&nbsp;
                                                        <a href="{:url('users/shequ_zt',['id'=>$list.id,'zt'=>2])}" class="mt5 btn btn-xs btn-danger">驳回</a>
                                                    {/if}
                                                </td>
                                                <td>
                                                    <div class="input-group">
                                                        <textarea class="form-control" id="note_{$list.id}" >{$list.note}</textarea>
                                                        <span class="input-group-addon p0">
                                                            <button class="btn btn-info btn-xs" style="height: 100%;" type="button" onclick="note('{$list.id}')">修<br/>改</button>
                                                        </span>
                                                    </div>
                                                </td>
                                            </tr>
                                        {/foreach}
                                        </tbody>
                                    </table>
                                    <div class="row">
                                        <div class="col-md-6">
                                            {$lists->render()}
                                        </div>
                                        <div class="col-md-6">
                                            <p>总数：{$lists->total()}</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Page End here -->
                </div>
                <!-- End .outlet -->
            </div>
            <!-- End .content-wrapper -->
            <div class="clearfix"></div>
        </div>
        <!-- End #content -->
        {include file="../view/foot" /}
        <script src="/public/theme/win10/assets/plugins/forms/checkall/jquery.checkAll.js"></script>
        <script>
            $('.table').checkAll({
                masterCheckbox: '.check-all',
                otherCheckboxes: '.check'
            });
            function note(id){
                // console.log(id);
                var note = $('#note_'+id).val();
                // console.log(note);
                $.post("{:url('users/shequ_note')}",{"id":id,"note":note},function(data){
                    // console.log(data);
                    if(data.zt==1){
                        myalert = jqueryAlert({
                            'icon'    : '/public/chajian/alert-master/img/right.png',
                            'content' : data.msg,
                            'closeTime' : 2000,
                        });
                    }else{
                        myalert = jqueryAlert({
                            'icon'    : '/public/chajian/alert-master/img/error.png',
                            'content' : data.msg,
                            'closeTime' : 2000,
                        });
                    }
                }, "json");
            }
        </script>
    </body>
</html>